<template>
  <view class="activity-tip" v-if="visible">
    <text class="tip-points">+{{ points }} 积分</text>
    <text class="tip-desc">{{ description }}</text>
  </view>
</template>

<script>
export default {
  name: "ActivityTip",
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    points: {
      type: Number,
      default: 0,
    },
    description: {
      type: String,
      default: "",
    },
  },
};
</script>

<style lang="scss" scoped>
.activity-tip {
  position: fixed;
  top: 200rpx;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    rgba(255, 149, 0, 0.9),
    rgba(255, 94, 0, 0.9)
  );
  border-radius: 30rpx;
  padding: 6rpx 20rpx;
  display: flex;
  align-items: center;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: fadeInOut 1.8s ease forwards;

  .tip-points {
    color: #fff;
    font-size: 24rpx;
    font-weight: bold;
    margin-right: 8rpx;
  }

  .tip-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 22rpx;
  }
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-15rpx);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  85% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-15rpx);
  }
}
</style>
